feat: v0.4 — Deterministic Engine Pipeline (Rules + Bundling + Context Chain)#148
Merged
Conversation
added 5 commits
June 3, 2026 11:42
- Add diff_parser.rs: parse unified diff into FileChunk/DiffHunk/DiffLine with language detection, line tracking, binary/new/deleted file support - Add rules/ module (4 files): RuleEngine with 12 built-in rules + custom YAML rules, regex matching with language/exclude filters, post-match filter for localhost URL exclusion - Extend schema.rs: RulesConfig for .cora.yaml integration - Update review.rs: rule engine integration (pre-LLM + merge findings) - Add detect_language() with 40+ extensions incl. image/document/lock - All 266 tests pass, cargo clippy clean Refs: #116, #147 (v0.4 Engine Pipeline)
- Add bundling/ (3 files): Smart grouping by directory/language, flat batching, merge small groups, BundlingConfig with 34 tests - Add context/ (4 files): Symbol extraction (imports, fn calls, types) per language (Rust/Python/JS/Go/Java), cross-file resolver with token budget, ContextConfig - Extend schema.rs: BundlingConfig, ContextConfig in ReviewSection - 351 tests pass Refs: #115, #114, #147 (v0.4 Engine Pipeline)
- Remove duplicate #[allow(dead_code)] in bundling mod.rs - Fix duplicate ContextConfig import in context mod.rs - Fix private GroupingStrategy re-export path - Use struct field init instead of Default + reassign - Use rsplit_once instead of manual suffix stripping - 351 tests pass, 4 clippy warnings (expected dead code) Refs: #147 (v0.4 Engine Pipeline)
Refs: #147 (v0.4 Engine Pipeline)
🔍 Cora AI Code Review❌ Blocked — critical issues found. 🔴 Error (3)
Review powered by cora-cli · BYOK · MIT |
added 2 commits
June 3, 2026 13:10
Previously, if the LLM call returned an error (auth, timeout, network), all deterministic rule findings were silently discarded because the ? operator propagated the error before merge. Now: on LLM failure, if rule findings exist, return a fallback ReviewResponse with only deterministic findings. This ensures pre-commit hooks always surface security/best-practice violations regardless of LLM availability.
- Add #[allow(dead_code)] to v0.5-forward items (ExtractedSymbol, ContextChain.stats, extract_added_lines, parse_and_run_rules) - Run cargo fmt on all files (context/extraction.rs, types.rs, review.rs, matching.rs import order)
| return true; | ||
| } | ||
| } | ||
|
|
- Reverse upload-sarif default to true (opt-out, not opt-in) - Rename SARIF tool driver to CodeCora (branding) - Add fullName field: codecoradev/cora-cli - Update watermark: Reviewed by CodeCora vX.Y.Z - Add test for fullName field verification
| "{ctx}\n\n## Cross-file Context\n{context_chain_text}", | ||
| context_chain_text = context_chain.text | ||
| )), | ||
| None => Some(format!("## Cross-file Context\n{}", context_chain.text)), |
| }, | ||
| CustomRule { | ||
| id: "sec-sql-concat".to_string(), | ||
| pattern: r##"format!\("SELECT|f"SELECT|f"INSERT|f"UPDATE|f"DELETE|query\s*\+="## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the v0.4 engine pipeline (#147) — three-phase deterministic analysis layer that runs before LLM review.
Changes
Phase 1: Deterministic Rule Engine (#116)
FileChunk/DiffHunk/DiffLinewith language detection (70+ extensions).cora.yamlPhase 2: File Bundling (#115)
.cora.yamlconfig:strategy,max_chars_per_group,max_files_per_groupllm.rschanges)Phase 3: Context Chain (#114)
.cora.yamlconfig:review.context_chain.enabled,max_context_tokens,follow_depthSchema Extension
BundlingConfig,ContextConfig,RulesConfigadded toConfigand.cora.yamlparsingTest Results
cargo checkclean,cargo fmtappliedWhat's Deferred to v0.5
llm.rsrefactor to accept per-bundle diffsCloses #116, #115, #114. Epic: #147